set(CMAKE_CONFIGURATION_TYPES Debug Release)

file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/debug.txt" "debug content")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/release.txt" "release content")

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/debug.txt" DESTINATION "foo" CONFIGURATIONS Debug)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/release.txt" DESTINATION "foo" CONFIGURATIONS Release)

set(CPACK_INSTALL_CMAKE_CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
